#include <linux/init.h>
#include <linux/module.h>
#include <linux/fs.h>

MODULE_LICENSE("GPL");

static unsigned int major = 200;
static unsigned int minor = 0;
static dev_t devt;

static int __init led_drv_init(void)
{
    int rc;
    devt = MKDEV(major, minor);

    rc = register_chrdev_region(devt, 1, "leds");
    if (rc)
    {
        pr_err("failed to register chrdev region\n");
    }
    return 0;
}

static void __exit led_drv_exit(void)
{
    unregister_chrdev_region(devt, 1);
}

module_init(led_drv_init);
module_exit(led_drv_exit);